<!DOCTYPE html>
<html lang="en">
<html>
<head>
    <meta charset="UTF-8"/>
    <title>修改密码</title>
    <script src="/js/jquery.js"></script>
    <script type="text/javascript">
        /*   $(function () {
      页面加载完毕事件的写法
           })*/
        $(function () {
            $("#update").click(function () {
                var oldpassword=$("#oldpassword").val();
                var newpassword=$("#newpassword").val();
                var  repassword=$("#repassword").val();
                var userid=$("#userid").val();
                var password=$("#passord").val();
                $.ajax({
                    url:"/updatePasswod",
                    data:{oldpassword:oldpassword,newpassword:newpassword,repassword:repassword,userid:userid,password:password},
                    type:"post",
                    dataType:"json",
                    success:function (result) {
                        if(result.code==0){
                            alert("修改成功");
                            location.href="/list";
                        }else {
                            alert(result.msg);
                        }

                    }

                })
            })
        })

    </script>
</head>
<body>
<form id="form">
    <input type="hidden" id="passord" value="${password}" name="password">
    <input type="hidden" id="userid" value="${userid}" name="userid">
    <input id="oldpassword" name="oldpassword">旧密码
    <input id="newpassword"name="newpassword">新密码
    <input id="repassword" name="repassword">再次确认密码
    <button type="button" id="update">修改</button>
    <a href="index.jsp"   >返回</a>
</form>
</body>
</html>